/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.ui.function.window.main;

import java.awt.event.ActionEvent;

import lineage.ui.customize.L1CustomizeButton;

/**
 * 系统按钮-用于显示系统信息框.
 * 
 * @version 2014年2月13日下午6:43:52
 * @author jrwz
 */
public final class L1ButtonBoxSystemMessage extends L1CustomizeButton {
    private static final long serialVersionUID = -5968531169728153709L;

    /**
     * 静态初始化器，由JVM来保证线程安全.
     */
    private static class Holder {
        static L1ButtonBoxSystemMessage instance = new L1ButtonBoxSystemMessage();
    }

    /**
     * 取得该类的实例.
     */
    public static L1ButtonBoxSystemMessage getInstance() {
        return Holder.instance;
    }

    private L1ButtonBoxSystemMessage() {
        // 要设置的部分
        _x = 5;
        _y = 3;
        // _width = 60;
        // _height = 50;
        presetText = "系统";
        toolTipText = "显示系统信息框";
        imgURL = "./image/button/0.png";
        imgOverURL = "./image/button/1.png";
        imgPressedURL = "./image/button/2.png";
        imgDisabledURL = "./image/button/3.png";
        // end

        init(true);
        setEnabled(false);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getModifiers() == 16) { // 鼠标左键单击
            L1BoxChatStatus.buttonChange(L1BoxChatStatus.SYSTEM_MESSAGE);
        }
    }
}
